from _vterm import ffi


class Vterm(object):
    def __init__(self, lib, rows: int, cols: int):
        self._lib = lib
        self._vterm = lib.vterm_new(rows, cols)

    def __del__(self):
        if self._vterm is not None:
            self._lib.vterm_free(self._vterm)
